package com.jz.community.modulemine.ui.view;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.jz.community.modulemine.R;


/**
 * Created by Ani_H on 2017/11/4.
 */

public class ChestDialog extends AlertDialog {
    private Context mContext;
    private int layout;
    private int day;


    private ImageView chest_back;
    private TextView chest_day;

    @SuppressLint("InflateParams")
    public ChestDialog(Context context) {
        super(context, R.style.ChestDialog);
        this.mContext = context;

    }

    @SuppressLint("InflateParams")
    public ChestDialog(Context context, int layout) {
        super(context, R.style.ChestDialog);
        this.mContext = context;
        this.layout = layout;

    }

//    public ChestDialog(Context context, int day) {
//        super(context);
//        this.mContext = context;
//        this.day = day;
//
//    }

//    @Override
//    public View onCreateView() {
//        widthScale(0.85f);
//        dimEnabled(true);
//        showAnim(new Swing());
//        dismissAnim(new SlideBottomExit());
//
//        View inflate = View.inflate(mContext, R.layout.dialog_chest, null);
//        chest_back = (ImageView) inflate.findViewById(R.id.sign_chest_back);
//        chest_day = (TextView) inflate.findViewById(R.id.sign_chest_day);
//        inflate.setBackgroundDrawable(
//                CornerUtils.cornerDrawable(Color.parseColor("#ffffff"), dp2px(5)));
//
//        return inflate;
//    }
//
//    @SuppressLint("SetTextI18n")
//    @Override
//    public void setUiBeforShow() {
//        chest_day.setText((7 - day) + "");
//        chest_back.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                dismiss();
//            }
//        });
//
//    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(layout);

    }

    @Override
    public void show() {
        super.show();

//        WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
//        layoutParams.gravity = Gravity.BOTTOM;
//        layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
//        layoutParams.height = WindowManager.LayoutParams.MATCH_PARENT;
//        getWindow().getDecorView().setPadding(0, 0, 0, 0);
//        getWindow().setAttributes(layoutParams);
    }

    @Override
    public void dismiss() {
        super.dismiss();
    }

//    private void aniShow() {
//        AnimatorSet animatorSet = new AnimatorSet();
//        animatorSet.playTogether(//
//                ObjectAnimator.ofFloat(chestDialog, "alpha", 1, 1, 1, 1, 1, 1, 1, 1),//
//                ObjectAnimator.ofFloat(chestDialog, "rotation", 0, 10, -10, 6, -6, 3, -3, 0));
//        animatorSet.setDuration(1000);
//        animatorSet.start();
//    }
}
